home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / blendGraphEdit.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.6 KB  |  81 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  November, 1999
  22. // Author:         divin
  23. //
  24. //
  25. //  Procedure Name:
  26. //      blendGraphEdit
  27. //
  28. //  Description:
  29. //              Creates a graph editor for the given blend curve.
  30. //
  31. //
  32. //  Input Arguments:
  33. //      $blendName  - The name of the curve to show in the editor.
  34. //      $updateOnly - Whether or not the editor should only update
  35. //                    its selection if the editor already exists.
  36. //
  37. //  Return Value:
  38. //      None.
  39. //
  40.  
  41. global proc blendGraphEdit(string $blendName, int $updateOnly)
  42. {
  43.     string $win   = ($blendName + "GraphWindow");
  44.     string $form  = ($blendName + "GraphForm");
  45.     string $ed    = ($blendName + "GraphEditor");
  46.     string $conn  = ($blendName + "FromClipEditor");
  47.     string $title = ("Blend: "  + $blendName);
  48.     
  49.     // If this window already exists, just show it.  Otherwise,
  50.     // return if a window should not be created.
  51.     if (`window -exists $win`) {
  52.         if ($updateOnly)
  53.             selectionConnection -e -select $blendName $conn;
  54.         else
  55.             showWindow $win;
  56.         return;
  57.     }
  58.     else if ($updateOnly)
  59.         return;
  60.         
  61.     // Create a selection connection which is used to pass the curve
  62.     // to the graph editor.
  63.     if (!`selectionConnection -exists $conn`)
  64.         selectionConnection $conn;
  65.         
  66.     // Create a graph editor inside a form.
  67.     window -title $title $win;
  68.     formLayout $form;
  69.     animCurveEditor -mainListConnection $conn $ed;
  70.     formLayout -edit
  71.         -attachForm $ed "left" 0
  72.         -attachForm $ed "right" 0
  73.         -attachForm $ed "bottom" 0
  74.         -attachForm $ed "top" 0
  75.         $form;
  76.     showWindow $win;
  77.     
  78.     // Give the blend curve to the editor via the selection connection.
  79.     selectionConnection -e -select $blendName $conn;
  80. }
  81.